<?php

/*
|--------------------------------------------------------------------------
| Routes File
|--------------------------------------------------------------------------
|
| Here is where you will register all of the routes in an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

/*Route::get('/', function () {
    //return view('welcome');
	return 'Hello world!';
});*/

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| This route group applies the "web" middleware group to every route
| it contains. The "web" middleware group is defined in your HTTP
| kernel and includes session state, CSRF protection, and more.
|
*/

/*blog*/
Route::group(['middleware' => ['web']], function () {
    Route::get('/', 'BlogController@index');
    Route::get('/blog', 'BlogController@index');
    Route::get('/blog/index', 'BlogController@index');
    Route::get('/blog/detail/{id}', 'BlogController@blog');
    Route::get('/blog/login', 'BlogController@login');
    Route::post('/blog/signin', 'BlogController@signin');
    Route::get('/blog/signout', 'BlogController@signout');
    Route::get('/blog/praise/{id}', 'BlogController@praise');
});

/*home*/
Route::group(['middleware' => ['web', 'check']], function () {
    Route::get('/blog/home', 'BlogController@home');
    Route::get('/blog/edit/{id}', 'BlogController@edit');
    Route::post('/blog/update', 'BlogController@update');
    Route::get('/blog/add', 'BlogController@add');
    Route::post('/blog/insert', 'BlogController@insert');
    Route::get('/blog/delete/{id}', 'BlogController@delete');
});

/*Route::group(['middleware' => ['web', 'admin.login']], function () {
    Route::get('/', function () {
        //return view('welcome');
        return 'Hello world!';
    });
});*/

/*index*/
/*Route::group(['middleware' => ['web']], function () {
    Route::get('/index/test', 'IndexController@test');
    Route::get('/index/index', 'IndexController@index');
    Route::get('/index/chart', 'IndexController@chart');
    Route::post('/index/save', 'IndexController@save');
});*/

/*自定义*/
/*Route::get('/foo', function () {
    //return view('welcome');
    return 'Hello world! Xiao Ming';
});*/

//Route::get('/user/{id}', 'UserController@index');

/*show*/
//Route::get('/show/{id}', 'IndexController@show');

/*blog*/
//Route::get('/blog/{id}', 'BlogController@blog');